/**
 * Copyright (c) 2015-2030 by Beijing Yanlight Co., Ltd.
 * All rights reserved.
 */
package com.yanlight.app.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yanlight.app.request.AppVersionAddRequest;
import com.yanlight.app.request.AppVersionModifyRequest;
import com.yanlight.app.request.AppVersionQueryRequest;
import com.yanlight.app.service.AppVersionService;
import com.yanlight.support.http.Response;
import com.yanlight.util.ResponseUtil;

/**
 * 
 * @author haolw
 * @time 2017/12/25
 */
@RestController
@RequestMapping("/version")
public class AppVersionController {
	@Autowired
	private AppVersionService appVersionService;

	@PostMapping("/list")
	public Response list(AppVersionQueryRequest request) {
		return ResponseUtil.success(appVersionService.findList(request));
	}

	@PostMapping("/detail")
	public Response detail(Integer id) {
		return ResponseUtil.success(appVersionService.findDetail(id));
	}

	@PostMapping("/add")
	public Response add(AppVersionAddRequest request) {
		appVersionService.add(request);
		return ResponseUtil.success();
	}

	@PostMapping("/modify")
	public Response modify(AppVersionModifyRequest request) {
		appVersionService.modify(request);
		return ResponseUtil.success();
	}
	
	@PostMapping("/delete")
	public Response delete(Integer id) {
		appVersionService.delete(id);
		return ResponseUtil.success();
	}
}
